export class RuntimeException extends Error {
  name = "RuntimeException";
  code = 0;
  data = null;
  constructor(message: string, code: number, data = null) {
    super(message);
    this.code = code;
    this.data = data;
  }
}

export class HttpException extends RuntimeException {
  name = "HttpException";
}

export class RequestException extends RuntimeException {
  name = "RequestException";
  constructor(message: string, code: number, data = null) {
    super(message, 10000 + code, data);
  }
}

export class ServiceException extends RuntimeException {
  name = "ServiceException";
  constructor(message: string, code: number, data = null) {
    super(message, 20000 + code, data);
  }
}
